package com.im.netty.login;

import com.im.netty.message.Attributes;

import io.netty.channel.Channel;
import io.netty.util.Attribute;

/**
 * 
 * @author yutao
 */
public class LoginUtil {

	
	public static void markAsLogin(Channel channel) {
		channel.attr(Attributes.LOGIN).set(true);
	}
	
	public static boolean hasLogin(Channel channel) {
		Attribute<Boolean> loginAttr = channel.attr(Attributes.LOGIN);
		
		return loginAttr.get() != null;
	}
	
}
